﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Exercise14
{
    public partial class Form1 : Form
    {
        NumberFun NumFun = new NumberFun();
        User User;
        public Form1()
        {
            InitializeComponent();
        }
        private void BtnclearClick(object sender, EventArgs e)
        {
            TxtIn.Clear();
            TxtOut.Clear();
        }
        private void BtngetClick(object sender, EventArgs e)
        {
            TxtIn.BackColor = Color.White;
            User = NumFun.GetResult(TxtIn.Text);
            if (User.bIsNull) { TxtIn.BackColor = Color.Red; TxtOut.Text = User.StrMsg; return; }
            else TxtOut.Text = NumFun.Result;
        }
    }
}
